<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8">
    <meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0" />
    <title>第二种头部</title>
    <link rel="stylesheet" type="text/css" href="../../../css/api.css" />
    <link rel="stylesheet" type="text/css" href="../../../css/common.css" />
    <link rel="stylesheet" type="text/css" href="../../../css/aui-pull-refresh.css" />
    <link rel="stylesheet" type="text/css" href="../../../css/aui.css" />
    <style>
        html,
        body {
            width: 100%;
            min-height: 100%;
            background: #f7f7f7;
            line-height: 1;
        }
        /*修改icon*/

        .left_icon {
            font-size: 1rem!important;
            color: #000!important;
        }

        .right_img{
          width: 1rem;
        }
        /*修改头部标题*/

        .header_title {
            font-size: 0.9rem;
            font-weight: bold;
        }
        /*固定头部*/

        .header {
            background-color: #fff;
            border: none!important;
            z-index: 8!important;
        }
    </style>
</head>

<body>
    <header class="aui-bar aui-bar-nav header" id='header' style="padding-top:25px;">
        <a class="aui-pull-left aui-btn"  onclick="close_win()">
            <span class="aui-iconfont aui-icon-left left_icon"></span>
        </a>
        <div class="aui-title header_title">对方名字</div>
        <a class="aui-pull-right aui-btn" onclick="open_new_win('two','详细资料','单聊资料','../../../image/four/delete_friend.png')">
            <img src="../../../image/four/person_detail.png" alt="" class="right_img">
        </a>
    </header>

</body>
<script type="text/javascript" src="../../../script/api.js"></script>
<script type="text/javascript" src="../../../script/jquery.min.js"></script>
<script type="text/javascript" src="../../../script/vue.min.js"></script>
<script type="text/javascript" src="../../../script/utils.js"></script>
<script type="text/javascript" src="../../../script/common.js"></script>
<script type="text/javascript" src="../../../script/aui-tab.js"></script>
<script type="text/javascript" src="../../../script/aui-scroll.js"></script>
<script type="text/javascript" src="../../../script/aui-pull-refresh.js"></script>
<script type="text/javascript">
    apiready = function() {

      api.execScript({
          name: 'four_frame/four_index.html',
          frameName: 'chat_list',
          script: 'window.location.reload();'
      });
      //获取header的高度
      var oHeader = $api.byId("header");
      var headerH = $api.offset(oHeader).h;
      $('.header_title').text(api.pageParam.target_name);
        //打开单聊的页面
        api.openFrame({
            name: 'single_chat',
            url: '../single_chat.html',
            rect: {
                x: 0,
                y: headerH,
                w: 'auto',
                h: 'auto'
            },
            pageParam: {
                target_id:api.pageParam.target_id,
                target_name:api.pageParam.target_name
            },
            bounces: false,
            bgColor: 'rgba(0,0,0,0)',
            vScrollBarEnabled: true,
            hScrollBarEnabled: true
        });



    };

    // 关闭当前窗口
    function close_win(){
      api.closeWin({});
      api.execScript({
          name: 'four_frame/four_index.html',
          frameName: 'chat_list',
          script: 'shuaxin();'
      });
    }



    // 打开新的窗口
    function open_new_win(index,title,type,image_src){
      api.openWin({
          name: 'four_'+index+'_header',
          url: 'four_'+index+'_header.html',
          pageParam: {
              title:title,
              type:type,
              img_src:image_src,
              target_id:api.pageParam.target_id
          }
      });

    }

</script>

</html>
